import sys

#file= sys.stdout
#file.write('Hello')
#print('Hello')
file = open('test.txt', 'rb')
print(file.read(3))
print(file.tell())
print(file.seek(2, 1))
# # 不需要close
# with open('test.txt','r',encoding='utf-8') as file2:
#     # readlines一次性读取所有文本信息
#     readlines = file2.readlines()
#     print(readlines)
#
#
# str="day day up"
# with open('test.txt','w',encoding='utf-8') as file3:
#     file3.write(str)
#
#
# list =['hello1','hello2']
# with open('test.txt','w',encoding='utf-8') as file4:
#     writelines = file4.writelines(list)
#     print(writelines)
#